package chapter04.Example24_31.Example30;
public class DivideByMinusException extends Exception{
    public DivideByMinusException(){
        super("");
    }
    public DivideByMinusException(String message){
        super();
    }
}
public class Example30 {
    public static void main(String[] args) {
        int result = divide(4,-2);
        System.out.println(result);
    }
    public static int divide(int a, int b) {
        if(y<0){
            throw new DivideByMinusException("除数是负数");
            int result = a/b;
            return result;
        }
    }
}
